import { actionType } from "../common/common_enum";
import AttackStatus from "./PlayerStatus/AttackStatus";
import IdleStatus from "./PlayerStatus/IdleStatus";
import RunStatus from "./PlayerStatus/RunStatus";
import Skill1Status from "./PlayerStatus/Skill1Status";
import Skill2Status from "./PlayerStatus/Skill2Status";
import WalkStatus from "./PlayerStatus/WalkStatus";
import { RootStatus } from "./RootStatus";
import StatusMachine from "./StatusMachine";

/**状态机 */
export default class PlayerStatusMachine extends StatusMachine{
    player_main = null; //角色脚本
    plyaer_skin:cc.Node = null; //角色动画

    mapStatusInfo:Map<actionType, RootStatus> = new Map()

    curStatus:RootStatus = null;

    nCurStatusKey:actionType = actionType.Idle;

    constructor(main, skin:cc.Node){
        super();
        this.player_main = main;
        this.plyaer_skin = skin;

        this.mapStatusInfo.set(actionType.Idle,new IdleStatus(this,this.plyaer_skin));
        this.mapStatusInfo.set(actionType.Walk,new WalkStatus(this,this.plyaer_skin));
        this.mapStatusInfo.set(actionType.Run,new RunStatus(this,this.plyaer_skin));
        this.mapStatusInfo.set(actionType.Attack,new AttackStatus(this,this.plyaer_skin));
        this.mapStatusInfo.set(actionType.Skill1,new Skill1Status(this,this.plyaer_skin));
        this.mapStatusInfo.set(actionType.Skill2,new Skill2Status(this,this.plyaer_skin));
    }

}
